<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>

<html>
<head>
    <title>登录页</title>
    <%--echart线图、柱状图、饼图等各种图型库 cdn--%>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <%--jquery cdn--%>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>
<form action="/list.do">
    报销人<input name="name" value="${query.name}"> <br>
    报销类型 <select name="applyTypeId">
    <option value="">请选择</option>
    <c:forEach items="${typeList}" var="t">
        <option   ${query.applyTypeId == t.id ? 'selected':''}     value="${t.id}">${t.name}</option>
    </c:forEach>

</select><br>
    状态 <select name="status">
    <option value="">请选择</option>
    <option  ${query.status == 1 ? 'selected':''}  value="1">未报销</option>
    <option  ${query.status == 2 ? 'selected':''}  value="2">已报销</option>


</select><br>
    <input type="submit" value="查询">
    <a href="addPage.do">添加</a>



    <table>
        <tr>
            <td>操作</td>
            <td>id</td>
            <td>报销类型</td>
            <td>金额</td>
            <td>报销人</td>
            <td>状态</td>
            <td>报销日期</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${pageInfo.list}" var="apply">

            <tr>
                <td><img style="width: 50px;height: 50px" src="${apply.url}"> ${apply.name}</td>
                <td>${apply.id}</td>
                <td>${apply.applyTypeName}</td>
                <td>${apply.amount}</td>
                <td>${apply.name}</td>
                <td>${apply.status ==1 ?'未报销':'已报销'}</td>
                <td>${apply.applyDate}</td>
<%--                <td><input type="button"  ${apply.status !=1 ? 'disabled':''} onclick="changeStatus(${apply.id})" value="完成报销"></td>--%>
                <td><a href="/changeStatus.do?id=${apply.id}">完成报销</a></td>
            </tr>
        </c:forEach>
        <tr>
            <td><button name="pageNum" value="1">首页</button></td>
            <td><button name="pageNum" value="${pageInfo.prePage}">上页</button></td>
            <td><button name="pageNum" value="${pageInfo.nextPage}">下页</button></td>
            <td><button name="pageNum" value="${pageInfo.pages}">尾页</button></td>

        </tr>
    </table>
</form>

</body>
</html>